/*******************************************************************************
********************************************************************************
************************** Master ZOC Script *********************************** 
********************************************************************************
********************************************************************************
*******************************************************************************/

set trace off
set tracedepth 2
timer clear 
timer on 1

capture program drop runcode 
program define runcode

	codepaths 

    * install package dependencies
	do $code/0_installpackages.do 
    local script "$code/0_installpackages.R"
    shell /Library/Frameworks/R.framework/Resources/bin/R --vanilla <`script'
    
    * Construct LAUSD panel 
	do $code/0_buildLAUSD.do
    
    * Construct ZOC analysis datasets 
	do $code/1_buildZOC.do 
    
    * Run analysis 
	do $code/2_ANALYSIS_ZOC.do 

end 

capture program drop codepaths 
program define codepaths 
	global dir "DIRECTORY1"
	global code "$dir/code"	
	
end 

runcode 

